<!DOCTYPE html>
<html>
<head>
    <title>座位和房间查询</title>
</head>
<body>
    <h1>请输入您的名字:</h1>
    <input type="text" id="nameInput" placeholder="输入名字">
    <button onclick="showInfo()">提交</button>
    <p id="seatInfo"></p>
    <p id="roomInfo"></p>

    <script>
        // 假设我们有一个对象，其中包含名字、座位号和房间号
        var data = {
            "张三": {"座位号": "A1", "房间号": "101"},
            "李四": {"座位号": "B2", "房间号": "102"},
            // 添加更多名字和信息...
        };

        function showInfo() {
            var name = document.getElementById("nameInput").value;
            if (data[name]) {
                document.getElementById("seatInfo").textContent = "座位号: " + data[name]["座位号"];
                document.getElementById("roomInfo").textContent = "房间号: " + data[name]["房间号"];
            } else {
                document.getElementById("seatInfo").textContent = "未找到该名字的座位号信息";
                document.getElementById("roomInfo").textContent = "未找到该名字的房间号信息";
            }
        }
    </script>
</body>
</html>
